
import 'package:extended_image/extended_image.dart';
import 'package:flutter/material.dart';
import 'package:flutter_frame/common/common_config.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';

import '../assets/color_config.dart';
import 'theme_util.dart';

CommonPageConfig commonPageConfig = CommonPageConfig();

class CommonPageConfig {
  ///是否显示debug下的图标
  bool  debugShowCheckedModeBanner = true;


  //app的状态栏样式
  Function appBarLightTheme = () {
    return AppBarTheme(
      systemOverlayStyle: ThemeUtil.systemOverlayStyleLight,
      backgroundColor: Colors.white,
      foregroundColor: Colors.black,
      centerTitle: true,
      elevation: 0.3,
      titleTextStyle: TextStyle(
        fontSize: 18.sp,
        color: ColorConfig.colorBlack,
        fontWeight: FontWeight.bold,
      ),
      iconTheme: IconThemeData(
        color: ColorConfig.colorBlack,
      ),
      actionsIconTheme: IconThemeData(
        color: ColorConfig.colorBlack,
      ),
    );
  };

  //app的整体风格样式
  Function appBarDarkTheme = () {
    return AppBarTheme(
      systemOverlayStyle: ThemeUtil.systemOverlayStyleDark,
      backgroundColor: Colors.grey[900],
      foregroundColor: Colors.white,
      centerTitle: true,
      elevation: 0.3,
      titleTextStyle: TextStyle(
        fontSize: 18.sp,
        color: const Color(0xffAAAAAA),
        fontWeight: FontWeight.bold,
      ),
      iconTheme: const IconThemeData(
        color: Color(0xffAAAAAA),
      ),
      actionsIconTheme: const IconThemeData(
        color: Color(0xffAAAAAA),
      ),
    );
  };

  ///图片缺省widget
  Function failedWidgetBuilder = (double? width, double? height, BoxFit? fit) {
    return ExtendedImage.asset(
      "$assetImage/base/placeholder.png",
      width: width,
      height: height,
      fit: fit ?? BoxFit.scaleDown,
    );
  };
}
